﻿namespace Microsoft.VisualStudio.TextTemplating.CommandLine
{
    using System;
    using System.Collections.Specialized;
    using System.Globalization;
    using System.Reflection;

    [Serializable]
    internal class CommandOptionCollection : NameObjectCollectionBase
    {
        public void Add(CommandOption option)
        {
            base.BaseAdd(option.Name.ToLower(CultureInfo.CurrentUICulture), option);
        }

        public bool Contains(string name)
        {
            return (base.BaseGet(name.ToLower(CultureInfo.CurrentUICulture)) != null);
        }

        public void Remove(string optionName)
        {
            base.BaseRemove(optionName.ToLower(CultureInfo.CurrentUICulture));
        }

        public CommandOption this[string name]
        {
            get
            {
                return (CommandOption) base.BaseGet(name.ToLower(CultureInfo.CurrentUICulture));
            }
        }
    }
}

